package com.test.action;

import java.util.Date;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.apache.struts2.dispatcher.ServletDispatcherResult;

import com.painarthur.rbac.action.BaseAction;

@ParentPackage("default")
@Namespace(value="/")
@Result(location = "/MyJsp.jsp")
@Results({  
    @Result(name="success1", location="/login.jsp"),
    @Result(name="success2",  location="/welcome.jsp")  
    }) 
public class UserLoginAction  extends BaseAction{  
	private static final long serialVersionUID = 1L;
	private String name;  
	@Action(value="login_go")
	public String addStudent(){
		System.out.println("-----");
		return "success1";
	}
	
	@Action(value="login_welcome")
	public String welcome(){
		System.out.println("name:"+name);
		name = "aaa";
		return "success2";
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	
}

